<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>'请选择供应商'))}
	<div class="operate-panel">
		<div class="x-panel-body">
			<div class="pull-left">
				<a  id="btn_save" class="btn">确定</a>
			</div>
			<div class="pull-right">
				<a  onclick="myclose();" class="btn">关闭</a>
			</div>
		</div>
	</div>
	<div class="popup_tree_menu">
		<ul class="tree_menu">
			{$menu}
		</ul>
	</div>
	<input type="hidden" name="val" id="val">
	<input type="hidden" name="name" id="name">
	<script type="text/javascript">
		function save() {
			if ($("#name").val().length > 0) {
				$("#supplier_name", parent.document).val($("#name").val());
				$("#supplier", parent.document).val($("#val").val());
			} else {
				ui_error("请选择节点");
				return false;
			}
			myclose();
		}


		$(document).ready(function() {
			parent_node = $(".sub-sidebar ul.tree_menu a.active", parent.document).attr("node");
			$("ul.tree_menu a[node='" + parent_node + "']").addClass("disabled");
			$(".popup_tree_menu a:not('.disabled')").click(function() {
				$("#val").val($(this).attr("node"));
				$("#name").val($(this).children("span").text());
				$(".tree_menu a.active").removeClass("active");
				$(this).addClass("active");
			})
		});
	</script>
</block>